package org.simplecrm.repository.event;

import org.simplecrm.domain.event.Event;

import java.util.List;

/**
 * Defines an interface for obtaining and changing data of DB
 * from table "event".
 */
public interface EventDAO {

    static final String EVENT_ID_FIELD = "id";
    static final String EVENT_CUSTOMER_ID_FIELD = "customerId";
    static final String EVENT_TYPEID_FIELD = "typeId";
    static final String EVENT_DESCRIPTION_FIELD = "description";
    static final String EVENT_DATE_FIELD = "creationDate";
    static final String EVENT_STATUS_FIELD = "status";
    static final String EVENT_SUPPORT_ID_FIELD = "supportId";

    /**
     * Is used for getting all the events of specified customer.
     *
     * @param customerId customer's identifier
     * @return
     */
    List<Event> getEventsOfCustomer(int customerId);

    /**
     * Is used for getting event with specified id.
     *
     * @param id event's identifier
     * @return
     */
    Event getEventById(int id);

    /**
     * Is used for deleting event with specified id.
     *
     * @param id event's identifier
     */
    void deleteEvent(int id);

    /**
     * Is used for creating new event for customer.
     *
     * @param newEvent event's object
     */
    void addNewEvent(Event newEvent);

    /**
     * Is used for making changes in existing event.
     *
     * @param updatedEvent event's object
     */
    void updateEvent(Event updatedEvent);
}